package com.hxkj.service;

import com.hxkj.domain.po.AuthRole;
import com.hxkj.domain.po.AuthUser;
import com.hxkj.domain.po.FunctionMenu;
import com.hxkj.domain.po.FunctionSite;
import com.hxkj.token.po.LoginToken;
import com.platform.common.domain.result.ResultDataStruct;

import java.util.List;
import java.util.Set;

/**
 * 用户service
 * <p>
 * Created by chenwei on 2018/5/15.
 */

public interface UserService {


    /**
     * 登录
     * @param user
     * @return
     * @throws Exception
     */
    ResultDataStruct<LoginToken> login(AuthUser user) throws Exception;


    /**
     * 根据账户获取用户
     * @param account
     * @return
     * @throws Exception
     */
    ResultDataStruct<AuthUser> getUser(String account) throws Exception;



    /**
     * 根据账户查询角色
     * @param account
     * @return
     */
    ResultDataStruct<Set<String>> findRolesByAccount(String account) throws Exception;


    /**
     * 根据账号查询permission集合
     * @param account
     * @return
     */
    Set<String> findPermissionsByAccount(String account) throws Exception;



    /**
     * 根据账号和appKey查找菜单集合
     * @return
     */

    List<FunctionMenu> findFunctionMenuByAccount(FunctionSite functionSite) throws Exception ;

    /**
     * 通过account和appkey获得
     * @return
     */
    ResultDataStruct<List<AuthRole>> getRolesByAccount(String account) throws Exception ;


    /**
     * 通过token获取用户信息成功
     * @param accessToken
     * @return
     * @throws Exception
     */
    ResultDataStruct<AuthUser> getUserInfoByTokenRemote(String accessToken) throws Exception ;


    /**
     * 通过id获取用户信息
     * @param userId
     * @return
     * @throws Exception
     */
    ResultDataStruct<AuthUser> getUserInfoByIdRemote(String userId) throws Exception;


}
